// #ifndef __DEBUG_H__
// #define __DEBUG_H__

// #include "vofa.h"


// template<typename... Ts>
// void debug(Ts&&... xs) 
// {
//     const char tail [4] = {0x00, 0x00, 0x80, 0x7f};
//     int i = 0;
//     float buf[sizeof...(xs) + 1];
//     (buf[i++] = xs,...);
//     memcpy(&buf[i++],&tail,sizeof(tail));
//     vofa::getVofa().send(buf,sizeof(buf));
// }


// #endif  //__DEBUG_H__

#ifndef __DEBUG_H__
#define __DEBUG_H__

#include "vofa.h"
#include <cstring>


template<typename... Ts>
void debug(Ts&&... xs)
{
    const unsigned char tail[4] = {0x00, 0x00, 0x80, 0x7f};
    constexpr std::size_t n = sizeof...(xs);
    float buf[n + 1];
    float* p = buf;
    (void(*p++ = static_cast<float>(xs)), ...);
    std::memcpy(p, tail, sizeof(tail));
    vofa::getVofa().send(buf, sizeof(buf));
}

#endif